<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">

<head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

	<title>无标题文档</title>

	<link href="/yilianti/Public/Admin/css/style.css" rel="stylesheet" type="text/css" />
	<link href="/yilianti/Public/Admin/css/page.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="/yilianti/Public/Admin/js/jquery.js"></script>
	<script type="text/javascript" src="/yilianti/Public/Admin/js/jquery.idTabs.min.js"></script>
	<script type="text/javascript" src="/yilianti/Public/Admin/js/select-ui.min.js"></script>
	
	<!-- 日历引入 -->
	<link href="/yilianti/Public/Admin/css/calendar.css" rel="stylesheet" type="text/css" />

	<!--文字编辑器引入-->
	<script type="text/javascript" charset="utf-8" src="/yilianti/Public/kindeditor/kindeditor-min.js"></script>
	<script type="text/javascript" charset="utf-8" src="/yilianti/Public/kindeditor/lang/zh_CN.js"></script>
	<link href="/yilianti/Public/kindeditor/themes/default/default.css" rel="stylesheet" type="text/css" />

	<script src="/yilianti/Public/Admin/js/layer/layer.js"></script>



</head>

<body>

	<div class="place">

		<span>位置：</span>

		<ul class="placeul">

		<li><a href="/yilianti/admin.php/Index/right">首页</a></li>

		
<li><a href="#">转诊列表</a></li>


		</ul>

    </div>


    <div class="rightinfo">
		<div class="tools">
			<ul class="seachform" style="float:left;height: 80px">
				<form name="search_form" action="/yilianti/admin.php/Referral/referrallist" method="GET">
					<li><label>患者姓名：</label><input type="text" class="scinput" name="pname" value="<?php echo ($pname); ?>" placeholder="请输入患者姓名..." /><div id="st" style="width: 350px;"></div></li>
					<li><label>病种标签：</label>
						<select class="select3 scinput" name="cateid">
							<option value="0">全部</option>
							<?php if(is_array($category)): foreach($category as $key=>$vo): ?><option value="<?php echo ($vo['id']); ?>" <?php if($where['cateid'] == $vo['id']): ?>selected="selected"<?php endif; ?>><?php echo ($vo['title']); ?></option><?php endforeach; endif; ?>
						</select>
					</li>
					<li><label>状态：</label>
						<select class="select3 scinput" name="state">
							<option value="0">全部</option>
							<?php if(is_array($statelist)): foreach($statelist as $key=>$vo): ?><option value="<?php echo ($vo['id']); ?>" <?php if($where['state'] == $vo['id']): ?>selected="selected"<?php endif; ?>><?php echo ($vo['title']); ?></option><?php endforeach; endif; ?>
						</select>
					</li>
					<li><label><input name="type" type="radio" value="1"<?php if($type==1){echo ' checked';}?>/>开始日期：</label><input type="text" class="scinput" name="timestart" id="starttime" value="<?php echo ($timestart); ?>" placeholder="请输入开始日期..." /><div id="st" style="width: 300px;"></div></li>
					<li><label>结束日期：</label><input type="text" class="scinput" name="timeend" id="endtime" value="<?php echo ($timeend); ?>" placeholder="请输入结束日期..." /><div id="et" style="width: 350px;"></div></li>
					<li><input name="type" type="radio" value="2"<?php if($type==2){echo ' checked';}?>/>
						<label>时间段：</label>
						<select class="select3 scinput" name="time">
							<option value="5"<?php if($time==5){echo ' selected';}?>>全年</option>
							<option value="1"<?php if($time==1){echo ' selected';}?>>第1季度</option>
							<option value="2"<?php if($time==2){echo ' selected';}?>>第2季度</option>
							<option value="3"<?php if($time==3){echo ' selected';}?>>第3季度</option>
							<option value="4"<?php if($time==4){echo ' selected';}?>>第4季度</option>
							<option value="6"<?php if($time==6){echo ' selected';}?>>1-6月</option>
							<option value="7"<?php if($time==7){echo ' selected';}?>>7-12月</option>
						</select>
					</li>
					<li><label>&nbsp;</label><input type="submit" value="搜索" class="scbtn" /></li>
				</form>
			</ul>
		</div>
		<table class="imgtable">
			<thead>
				<tr>
					<th>ID</th>
					<th>患者姓名</th>
					<th>疾病类别</th>
					<th>来源医院</th>
					<th>现在所属医院</th>
					<th>转诊时间</th>
					<th>状态</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<?php if($list != null): if(is_array($list)): foreach($list as $key=>$listrow): ?><tr style="height:32px">
							<td><?php echo ($listrow["id"]); ?></td>
							<td><?php echo ($listrow["pname"]); ?></td>
							<td><?php echo (jbname($listrow["cateid"])); ?></td>
							<td><?php echo (hospital_pre($listrow["hospital_pre"])); ?></td>
							<td><?php echo (hospital_now($listrow["hospital_now"])); ?></td>
							<td><?php echo ($listrow["addtime"]); ?></td>
							<td><?php echo (state($listrow["state"])); ?></td>
							<td>
								<p>
									<a href="/yilianti/admin.php/Referral/referraldetail/id/<?php echo ($listrow["id"]); ?>">详情</a>&nbsp;&nbsp;
									<!--<a href="/yilianti/admin.php/Referral/patientmod/id/<?php echo ($listrow["id"]); ?>">修改</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
								<a href="/yilianti/admin.php/Referral/patientdel/id/<?php echo ($listrow["id"]); ?>" onclick="if (confirm('确定要删除吗？')) return true; else return false;">删除</a></p>
							</td>
						</tr><?php endforeach; endif; ?>
				<?php else: ?>
					<tr style="height:32px"><td colspan="9">暂无记录！</td></tr><?php endif; ?>
			</tbody>
		</table>
		<div class="yellow"><?php echo ($pageshow); ?></div>
    </div>
	<script type="text/javascript" src="/yilianti/Public/Admin/js/jquery2.js"></script>
	<script type="text/javascript" src="/yilianti/Public/Admin/js/calendar.js"></script>
<script type="text/javascript">
    $('#st').calendar({
        trigger: '#starttime',
        zIndex: 999,
        format: 'yyyy-mm-dd',
        onSelected: function (view, date, data) {
            console.log('event: onSelected')
        },
        onClose: function (view, date, data) {
            console.log('event: onClose')
            console.log('view:' + view)
            console.log('date:' + date)
            console.log('data:' + (data || 'None'));
        }
    });
    $('#et').calendar({
        trigger: '#endtime',
        zIndex: 999,
        format: 'yyyy-mm-dd',
        onSelected: function (view, date, data) {
            console.log('event: onSelected')
        },
        onClose: function (view, date, data) {
            console.log('event: onClose')
            console.log('view:' + view)
            console.log('date:' + date)
            console.log('data:' + (data || 'None'));
        }
    });
$('.imgtable tbody tr:odd').addClass('odd');
</script>


<script type="text/javascript">
KindEditor.ready(function(K) {
	K.create('#pagecontent', {
		allowFileManager : true
	});

	var editor = K.editor({
		allowFileManager : true
	});
	//上传图片（本地、网络）
	K('#uploadbtn').click(function() {
		editor.loadPlugin('image', function() {
			editor.plugin.imageDialog({
				showRemote : false,
				imageUrl : K('#titlepic').val(),
				clickFn : function(url, title, width, height, border, align) {
					K('#titlepic').val(url);
                    K('#showimg').attr('src',url);
                    K('#titlepicpreview').attr('src', url);
					editor.hideDialog();
				}
			});
		});
	});

	//文件上传
	K('#insertfile').click(function() {
		editor.loadPlugin('insertfile', function() {
			editor.plugin.fileDialog({
				fileUrl : K('#fileurl').val(),
				clickFn : function(url, title) {
					K('#fileurl').val(url);
					editor.hideDialog();
				}
			});
		});
	});
});
/*//实例化编辑器
	var editor = K.editor({
		allowFileManager : true
	});

	//文件上传
	K('#insertfile').click(function() {
		editor.loadPlugin('insertfile', function() {
			editor.plugin.fileDialog({
				fileUrl : K('#url').val(),
				clickFn : function(url, title) {
					K('#url').val(url);
					editor.hideDialog();
				}
			});
		});
	});
	
	//上传图片（本地、网络）
	K('#image1').click(function() {
		editor.loadPlugin('image', function() {
			editor.plugin.imageDialog({
				imageUrl : K('#url1').val(),
				clickFn : function(url, title, width, height, border, align) {
					K('#url1').val(url);
					editor.hideDialog();
				}
			});
		});
	});
});
//批量上传图片
KindEditor.ready(function(K) {
	var editor = K.editor({
		allowFileManager : true
	});
	K('#J_selectImage').click(function() {
		editor.loadPlugin('multiimage', function() {
			editor.plugin.multiImageDialog({
				clickFn : function(urlList) {
					var div = K('#J_imageView');
					div.html('');
					K.each(urlList, function(i, data) {
						div.append('<img src="' + data.url + '">');
					});
					editor.hideDialog();
				}
			});
		});
	});
});*/
</script>

</body>
</html>